﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Drawing;

using Noris.Schedule.Support;
using Noris.Schedule.Support.Services;
using Noris.Tools.FrxEditor.Data;

namespace Noris.Tools.FrxEditor
{
	static class MainCodeCls
	{
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main(params string[] arguments)
		{
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);

			Steward.SetExePathAsDefault();
            Steward.Diagnostic.DiagnosticEnabled = false;

			// Parametry aplikace:
			Steward.ParameterStore(arguments);

			Steward.AppInit();

            // string fileName = ReportDocument.FindReportFile("dw_testy_tab.srd");
            // ReportDocument doc = ReportDocument.CreateFromFile(fileName);

            // SqlCommands.SqlCommandTest.Run();
            // SimpleDataTableTest.TestMemory();

			OpenForm();
			Steward.AppDone();
		}
        static void TestSql()
        {
            string sql = @"/* Kontrola SQL parseru */
-- ještě jeden komentář
SELECT top 15 percent with ties s.nazev naz, s.cislo as cis, 20 * s.pocet 
 from [database] .lcs.subjekty s where [subj]. [dbase].[s]pocet * max([lcs.abc'])> 0 order by naz
";
            var list = SqlCommands.SqlCommand.Parse(sql);
            // SqlCommand.SqlSelect s = SqlCommand.SqlSelect.ParseFrom(sql);
        }
		static void OpenForm()
		{
			Steward.RunGUI(typeof(Forms.EditorForm));
            // Steward.RunGUI(typeof(Forms.TestViewPort));
		}
        // C=c:\inetpub\wwwroot\Noris43\Noris\noris.config /AllRight
        // W=c:\inetpub\wwwroot\noris43\noris\bin\noris.dll Sc=RGF0YSBTb3VyY2U9REFKLTctRFxEQUpfN19EO0luaXRpYWwgQ2F0YWxvZz1OVjQzX3NvdXJjZTtJbnRlZ3JhdGVkIFNlY3VyaXR5PUZhbHNlO1VzZXIgSUQ9bmV0YWRtaW47UGFzc3dvcmQ9c2FydW1hbjtNdWx0aXBsZUFjdGl2ZVJlc3VsdFNldHM9RmFsc2U7Q29ubmVjdCBUaW1lb3V0PTE0NDAwO0VuY3J5cHQ9RmFsc2U7Q3VycmVudCBMYW5ndWFnZT0= D=localW7.NV43_source ProfileList=Disable Us=157529 S=4092318680634934050 ReadOnly=true
        // W=c:\inetpub\wwwroot\noris43\noris\bin\noris.dll Sc=RGF0YSBTb3VyY2U9REFKLTctRFxEQUpfN19EO0luaXRpYWwgQ2F0YWxvZz1OVjQzX3NvdXJjZTtJbnRlZ3JhdGVkIFNlY3VyaXR5PUZhbHNlO1VzZXIgSUQ9bmV0YWRtaW47UGFzc3dvcmQ9c2FydW1hbjtNdWx0aXBsZUFjdGl2ZVJlc3VsdFNldHM9RmFsc2U7Q29ubmVjdCBUaW1lb3V0PTE0NDAwO0VuY3J5cHQ9RmFsc2U7Q3VycmVudCBMYW5ndWFnZT0= D=localW7.NV43_source ProfileList=Disable Us=157529 S=4092318680634934050 ReadOnly=false
	}
}